package com.android.jianboshi.dialog;

import android.view.View;

import androidx.fragment.app.FragmentActivity;

import com.android.baselibrary.dialog.BaseDialogFragment;
import com.android.baselibrary.interface_.CommCallBack;
import com.android.jianboshi.R;

import java.util.Map;

import butterknife.OnClick;

/**
 * Created by Administrator on 2018/8/29.
 */

public class PermisionNotice_DialogFragment extends BaseDialogFragment {

//    @BindView(R.id.iv_code)
//    ImageView iv_code;

    @Override
    protected int getLayoutId() {
        return R.layout.dialog_permision_notice;
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {
    }

    @Override
    protected boolean setCanceledOnTouchBACK() {
        return false;
    }

    @Override
    protected int getShowDirection() {
        return BaseDialogFragment.Direction_FromBottom;
    }

    @Override
    public void setData(Map<String, Object> params) {
        if (params != null) {

        }
    }

    public static BaseDialogFragment showDialog(FragmentActivity activity, Map<String, Object> params) {
         PermisionNotice_DialogFragment dialogFragment = new PermisionNotice_DialogFragment();
        dialogFragment.setData(params);
        dialogFragment.show(activity.getSupportFragmentManager(), "");
        return dialogFragment;
    }

    @OnClick({R.id.tv_deny,R.id.tv_accept})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_deny:        //拒绝
                if(callBack!=null)
                {
                    callBack.onResult(CommCallBack.Result_Fail);
                }
                dismiss();
                break;
            case R.id.tv_accept:     //同意
                if(callBack!=null)
                {
                    callBack.onResult(CommCallBack.Result_Success);
                }
                dismiss();
                break;
        }
    }


}
